import pymysql


class DataCleaning:

    @staticmethod
    def excute_sql(sql):
        conn = pymysql.connect(user='xluser', password='xluser', host='10.0.17.17', port=3306)
        cur = conn.cursor()
        try:
            cur.execute(sql)
            conn.commit()
        except Exception:
            conn.rollback()
        finally:
            cur.close()
            conn.close()


if __name__ == '__main__':
    d = DataCleaning()
    sql = "delete from application_center.app_system where application_code = 'code9527' "
    d.excute_sql(sql)
